package com.siteseat.common.entity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 */
public class EntityManager<T extends Entity> {

  protected List<T> entityList = new ArrayList<T>();
  protected Map<Integer,Integer> positions = new HashMap<Integer,Integer>();
  
  protected Map<Integer, T> idMap = new HashMap<Integer, T>();
  

  public T findById(Integer id) {
    return listById().get(id);
  }


  public List<T>  list() {
    return entityList;
  }
  
  public Map<Integer,T> listById() {
    return idMap;
  }
  
}
